package com.easa.service;

import com.easa.dao.TimetableDao;
import com.easa.entity.ShowTimetableByDay;
import com.easa.entity.Timetable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class TimetableSeviceImpl implements TimetableService{

    @Autowired
    private TimetableDao timetableDao;

    public List<ShowTimetableByDay> findCourseWithToday(Date today,String weekid){
        return timetableDao.findCourseWithToday(today,weekid);
    }

    public List<Timetable> findAllTimetable(Date today){
        return timetableDao.findAllTimetable(today);
    }

    public int insertClass(Timetable timetable){
        return timetableDao.insertClass(timetable);
    }

    public List<ShowTimetableByDay> findAllCourse(String searchDate,String weekid){
        return timetableDao.findAllCourse(searchDate,weekid);
    }

    public List<ShowTimetableByDay> findPersonCourse(String searchDate, String tid){
        return timetableDao.findPersonCourse(searchDate,tid);
    }

    public List<ShowTimetableByDay> findPersonCourseAWeek(String weekid, String tid){
        return timetableDao.findPersonCourseAWeek(weekid,tid);
    }

    public ShowTimetableByDay findTimetableByCid(int cid){
        return timetableDao.findTimetableByCid(cid);
    }

    public int deleteClassByCid(int cid){
        return timetableDao.deleteClassByCid(cid);
    }

    public List<ShowTimetableByDay> getClassByAdmin(String tid, String lname, String classdate){
        return timetableDao.getClassByAdmin(tid,lname,classdate);
    }
}
